package com.lh.java.connect;



public class StaticTest {	
	public static void main(String[] args) {	
		StaticProperty sp1 = new StaticProperty();
		StaticProperty sp2;
		try {
			sp2 = (StaticProperty) sp1.clone();
			System.out.println(sp1.s2==sp2.s2);
			System.out.println(sp1==sp2);
			sp2.s2=new Long(333);		
			System.out.println(sp2.s2);
			System.out.println(sp1.s2);
			sp2.b.bb="new bbb";
			System.out.println(sp2.b.bb);
			System.out.println(sp1.b.bb);
			System.out.println(sp1.b==sp2.b);
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}		
	

	}

}
class StaticProperty implements Cloneable{	
	Long s2 = new Long(222);
	BB b = new BB();
	@Override
	protected Object clone() throws CloneNotSupportedException {		
		return super.clone();
	}
	
	
}
class BB {
	String bb =new String("i am class b");

	public String getBb() {
		return bb;
	}

	public void setBb(String bb) {
		this.bb = bb;
	}
}